/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.apache.info.service.plugins  
 */
package com.apache.info.service.plugins;

import com.apache.api.manager.PluginConnector;
import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.cache.util.Validator;
import com.apache.info.entity.PubInfoStatistics;
import com.apache.info.manager.PubInfoStatisticsManager;

/**
 * description:  信息统计表
 * @author dwusoft 创建时间：2015-10-15  
 * @Copyright(c)2014:北京--软件技术有限公司
 */
public class InfoStatisticsPluginImpl implements PluginConnector {

	private PubInfoStatisticsManager pubInfoStatisticsManager;

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see com.apache.api.manager.PluginConnector#execute(com.apache.api.vo.ParamsVo)  
	 */
	public Object execute(ParamsVo vo) throws Exception {
		ParamsVo pvo = new ParamsVo();
		PubInfoStatistics ps = new PubInfoStatistics();
		if (Validator.isNull(String.valueOf(vo.getParams("createUser")))) {
			ps.setInfoUser(String.valueOf(vo.getParams("createUser")));
		}
		if (Validator.isNull(String.valueOf(vo.getParams("sortId")))) {
			ps.setSortId(String.valueOf(vo.getParams("sortId")));
		}
		pvo.setObj(ps);
		long count = pubInfoStatisticsManager.countInfo(pvo);
		ResultEntity entity = new ResultEntity();
		entity.setResult("true");
		entity.setEntity(count);
		entity.setMessage("方法执行成功");//////////////////////
		return entity;
	}

	public void setPubInfoStatisticsManager(PubInfoStatisticsManager pubInfoStatisticsManager) {
		this.pubInfoStatisticsManager = pubInfoStatisticsManager;
	}

}
